package excption.work;

import excption.IllegalAgeException;

import java.io.FileNotFoundException;

public class Student {
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age)  {
        if (age<=0 ||age>=100){
//            throw new RuntimeException();//编译不出错运行出错
            throw new RuntimeException();//编译时要处理的·异常
        }
        this.age = age;
    }

}
